package com.chess.manager;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.chess.protobuf.EchoMsg.GameServerRegisterRequest;

public class GameServerManager {
	static Map<String,GameServerRegisterRequest> cache = new ConcurrentHashMap<>();
	
	public static void addCache(String sessionId,GameServerRegisterRequest info){
		cache.put(sessionId, info);
	}
	
	public static void removeCache(String sessionId){
		cache.remove(sessionId);
	}
	
	public static GameServerRegisterRequest getGameServer(){
		for (Map.Entry<String,GameServerRegisterRequest> g : cache.entrySet()) {
			return g.getValue();
		}
		return null;
	}
}
